package com.flute.haflute.agent.topo;

import java.io.Serializable;

/**
 * 节点封装对象
 */
public class Node implements Serializable {
	private static final long serialVersionUID = -4570461755127586437L;

	private String ip;

	public Node(String ip) {
		this.ip = ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	/*
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ip == null) ? 0 : ip.hashCode());
		return result;
	}

	/*
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Node other = (Node) obj;
		if (ip == null) {
			if (other.ip != null)
				return false;
		} else if (!ip.equals(other.ip))
			return false;
		return true;
	}

	public String getIp() {
		return ip;
	}

	/*
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return ip;
	}

}
